#!/bin/sh

uci -q batch <<-EOF >/dev/null
	delete ucitrack.@shadowsocksr[-1]
	add ucitrack shadowsocksr
	set ucitrack.@shadowsocksr[-1].init=shadowsocksr
	commit ucitrack
	delete firewall.shadowsocksr
	set firewall.shadowsocksr=include
	set firewall.shadowsocksr.type=script
	set firewall.shadowsocksr.path=/var/etc/shadowsocksr.include
	set firewall.shadowsocksr.reload=1
	commit firewall
EOF

killall -q -9 ssr-monitor ss-redir ssr-redir v2ray trojan ipt2socks ssr-server kcptun-client srelay
/usr/share/shadowsocksr/gfw2ipset.sh
rm -f /tmp/luci-indexcache
exit 0
